home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Copyright ⌐ 1997-1998 - Modelworks Software
-
- /**
- @Tool: foldAllChildren~closes all child lines of a parent line.
- @EndTool:
- @Summary: foldAllChildren~closes all child lines
- */
-
- //
- // Fold all children of the selected parent
- //
-
- function DoCommand()
- {
- var editor = getActiveEditor();
- if (editor)
- {
- var lines = editor.getLines();
- var selection = editor.GetSelection();
- var childIndex = lines.getFirstChildLineIndex(selection.startLineIndex);
- while (childIndex != -1)
- {
- lines.foldLine(childIndex);
- childIndex = lines.getNextSiblingLineIndex(childIndex);
- }
- lines.update("Fold All Children");
- }
- }
-
- !!/Script
-
-